﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using deckAnalyser.Domain;

namespace deckAnalyser.Controls
{
  public partial class DeckBuilderControl : UserControl
  {
    public DeckBuilderControl()
    {
      InitializeComponent();
    }

    private Deck deck;
    public Deck Deck
    {
      get { return deck; }
      set
      {
        deck = value;
        deckViewControl.Deck = deck;
        manaCompositionControl1.Deck = deck;
        manaCurveControl1.Deck = deck;
      }
    }

    private Collection collection;
    public Collection Collection
    {
      get { return collection; }
      set
      {
        collection = value;
      }
    }

    private void btnAdd_Click(object sender, EventArgs e)
    {
      String name = cardsetViewControl.CurrentCard;

      if (name != null)
      {
        deck.AddCard(name);
      }
    }

    private void btnRemove_Click(object sender, EventArgs e)
    {
      String name = deckViewControl.CurrentCard;

      if (name != null)
      {
        deck.RemoveCard(name);
      }

    }
  }
}
